home *** CD-ROM | disk | FTP | other *** search
- property channel, state, soundName
- global gRollAnimButton, gLoopButton
-
- on birth me, whichChan, whichSound
- set state to #idle
- set channel to whichChan
- set soundName to whichSound
- return me
- end
-
- on update me
- doRollover(me)
- end
-
- on doRollover me
- if state = #idle then
- if rollOver(channel) then
- if not soundBusy(1) and not objectp(gRollAnimButton) and not objectp(gLoopButton) then
- puppetSound(soundName)
- set state to #soundOn
- end if
- end if
- else
- if state = #soundOn then
- if not soundBusy(1) then
- puppetSound(0)
- set state to #soundDone
- end if
- else
- if not rollOver(channel) then
- set state to #idle
- end if
- end if
- end if
- end
-